set the castNum of sprite 2 to the number of cast "offScreen"
set BaseTrack to 24 - 1
repeat with i = 1 to count(TileLocs)
set the castNum of sprite (BaseTrack + i) to BtnCastNum
set ULloc to getAt(TileLocs, i)
set the rect of sprite (BaseTrack + i) to rect(the locH of ULloc, the locV of ULloc, the locH of ULloc + ShowWidth, the locV of ULloc + ShowHeight)
end repeat
updateStage()
end
on DisplayBigRectTiles BtnCastNum
set TileLocs to [point(368, 31), point(590, 31), point(368, 159), point(590, 159), point(368, 287), point(590, 287)]
set ShowWidth to 222
set ShowHeight to 128
set HiderCast to the number of cast "offScreen"
set the castNum of sprite 2 to HiderCast
set ULoffset to point(the locH of the regPoint of cast BtnCastNum - the left of the rect of cast BtnCastNum, the locV of the regPoint of cast BtnCastNum - the top of the rect of cast BtnCastNum)
set BaseTrack to 24 - 1
repeat with i = 1 to count(TileLocs)
set the castNum of sprite (BaseTrack + i) to BtnCastNum
set ULloc to getAt(TileLocs, i)
set the rect of sprite (BaseTrack + i) to rect(the locH of ULloc, the locV of ULloc, the locH of ULloc + ShowWidth, the locV of ULloc + ShowHeight)
end repeat
repeat with i = count(TileLocs) + 1 to 20
set the castNum of sprite (BaseTrack + i) to HiderCast
end repeat
updateStage()
end
on DisplayBigSquareTiles BtnCastNum
set TileLocs to [point(368, 34), point(496, 34), point(368, 162), point(496, 162), point(368, 290), point(496, 290)]
set ShowWidth to 128
set ShowHeight to 128
set HiderCast to the number of cast "offScreen"
set the castNum of sprite 2 to HiderCast
set ULoffset to point(the locH of the regPoint of cast BtnCastNum - the left of the rect of cast BtnCastNum, the locV of the regPoint of cast BtnCastNum - the top of the rect of cast BtnCastNum)
set BaseTrack to 24 - 1
repeat with i = 1 to count(TileLocs)
set the castNum of sprite (BaseTrack + i) to BtnCastNum
set ULloc to getAt(TileLocs, i)
set the rect of sprite (BaseTrack + i) to rect(the locH of ULloc, the locV of ULloc, the locH of ULloc + ShowWidth, the locV of ULloc + ShowHeight)
end repeat
repeat with i = count(TileLocs) + 1 to 20
set the castNum of sprite (BaseTrack + i) to HiderCast
end repeat
updateStage()
end
on displayimage BtnCastNum
set HiderCast to the number of cast "offScreen"
repeat with i = 24 to 43
set the castNum of sprite i to HiderCast
end repeat
set DisplayWidth to 608 - 368
if the width of cast BtnCastNum < DisplayWidth then
set StageHpos to point(488, 240)
set castCenter to point(the left of the rect of cast BtnCastNum + ((the right of the rect of cast BtnCastNum - the left of the rect of cast BtnCastNum) / 2), the top of the rect of cast BtnCastNum + ((the bottom of the rect of cast BtnCastNum - the top of the rect of cast BtnCastNum) / 2))
set CenterOffset to the regPoint of cast BtnCastNum - castCenter
else
set StageHpos to point(368, 240)
set castLeft to point(the left of the rect of cast BtnCastNum, the top of the rect of cast BtnCastNum + ((the bottom of the rect of cast BtnCastNum - the top of the rect of cast BtnCastNum) / 2))
set CenterOffset to the regPoint of cast BtnCastNum - castLeft
end if
set the castNum of sprite 2 to BtnCastNum
set the loc of sprite 2 to StageHpos + CenterOffset
updateStage()
end
on getMacFileNameFromPath aMacPath
set the itemDelimiter to ":"
set fName to item the number of items in aMacPath of aMacPath